﻿using System;
using System.IO;
using System.Threading.Tasks;

namespace Restful.Net.Serialization
{
    public interface ISerializer
    {
        /// <summary>
        /// Gets the content type to send in the response if this serializer is used.
        /// </summary>
        string ResponseContentType
        {
            get;
        }

        bool Supports(string contentType);
        void Serialize(object objectToserialize, Stream outputStream);
        
        object Deserialize(Type t, Stream inputStream);
        
        Task<object> DeserializeAsync(Type t, Stream inputStream);

        Task SerializeAsync(object objectToSerialize, Stream outputStream);
    }
}
